/**
 * Created by Johnny on 07/12/2016.
 */
'use strict';
var React = require('react-native');
var textToSpeechManager = React.NativeModules.TextToSpeechManager;
class TextToSpeechManager {

    constructor() {}

    textToSpeech(text) {
        return new Promise((fulfill, reject) => {
            textToSpeechManager.textToSpeechWithCallback(text, (error) => {
                if (error) {
                    reject(error);
                } else {
                    fulfill();
                }
            });
        });
    }
}

module.exports = new TextToSpeechManager();